const fs = require('fs')
const path = require('path')
// 入口，v7云客服 或 微前端
const entry = process.argv[2] || 'main'
// 开发环境  本地运行 || 打包环境
const type = process.argv[3] || 'dev'
const development = path.resolve(__dirname, './.env.development')
const envUrl = path.resolve(__dirname, './.env')
const fileName = type === 'dev' ? development : envUrl
fs.writeFile(fileName, `VUE_APP_ENTRY = ${entry}`, (err) => {
  if (err) throw err
})
